package com.acme.ioniolab.serialization.implementations;

import com.acme.ioniolab.serialization.SensorData;
import com.acme.ioniolab.serialization.Serializer;
import com.google.gson.Gson;

public class GsonSerializer implements Serializer {
	private Gson gson = new Gson();
	
	@Override
	public String getType() {
		return "Gson";
	}

	@Override
	public Object serialize(Object object) {
		return gson.toJson(object);
	}

	@Override
	public Object deserialize(Object object) {
		return gson.fromJson((String) object, SensorData.class);
	}

}
